﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="eForm.aspx.cs" Inherits="iSun.Web.Forms.eForm" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link rel="stylesheet" href="../dojo-release-1.7.2-src/dojo/resources/dojo.css"type="text/css" />
<link rel="stylesheet" href="../dojo-release-1.7.2-src/dijit/themes/claro/claro.css" />
<style>
 label
 {
     display:block; 
     width:100px;
     font-weight:bold; 
     float:left;
 }
 
 #Master .ColSpan0
 {
     width:380px;
     float:left;
 }

#Master .cspan2
{
    width:565px;
}

#Master .ColSpan1
{
     width:380px;
     float:left;
}
 
#Master .ColSpan2
{
     width:760px;
     float:left;
}
</style>
<script src="../Scripts/jquery-1.6.min.js" type="text/javascript"></script>
<script src="../Scripts/Jquery.form.js" type="text/javascript"></script>
<script src="../Scripts/jquery.json-2.2.min.js" type="text/javascript"></script>

<script type="text/javascript">
    //定义常量
    var const_Entity = "";// eval("(<%=const_Entity%>)"), //实体对象
        const_SaveUrl = "../Extend/AjaxData/DataSave.aspx", //保存的页面数径
        const_EnttiyName = "<% =EntityName %>",//实体名
        const_KeyValue = "<% =KeyValue %>", //关键值
        const_Action = "<%=DataAction %>", //操作方法
        const_Action = "<% =this.UserID %>"
        const_p = parent;//父页面
</script>
<script type="text/javascript">    dojoConfig = { parseOnLoad: true }</script>
<script type="text/javascript" src="../dojo-release-1.7.2-src/dojo/dojo.js"></script>
<script type="text/javascript">    require(["dojo/parser", "dijit/form/Form", "dijit/form/Button", "dijit/form/ComboBox", "dojo/store/Memory"]);</script>

<script type="text/javascript">
require([
    "dojo/ready", "dojo/dom", "dojo/store/Memory", "dijit/form/FilteringSelect"
], function (ready, dom, Memory, FilteringSelect) {

    //此处用于生成字典所需的值！
    
    var dojoStore = new Memory({data: [
        {id: 1, name:"we", label:"<i>we</i> <img src='http://placekitten.com/50/70' />"},
        {id: 2, name:"are", label:"<u>are</u> <img src='http://placekitten.com/50/60' />"},
        {id: 3, name:"kittens", label:"<b>kittens</b> <img src='http://placekitten.com/50/50' />"}
    ]});

    ready(function(){
       new FilteringSelect({
             id: "dojoBox",
             value: 3,
             store: dojoStore,
             searchAttr: "name",
             name: "Select",
             labelAttr: "label",
             labelType: "html"
       }, dom.byId("dojoBox"));
    });
});
</script>
</head>
<body class="claro">
<div data-dojo-type="dijit/form/Form" id="myForm" data-dojo-id="myForm"
encType="multipart/form-data" action="" method="">

    <script type="dojo/on" data-dojo-event="reset">
    alert(dojo.toJson($("#myForm").extractObject()));
        return confirm('Press OK to reset widget values');
    </script>
    <script type="text/javascript" language="javascript">
    </script>
    <script type="dojo/on" data-dojo-event="submit">
        alert(dojo.toJson(myForm.getValues()));
        if(this.validate()){
            return confirm('Form is valid, press OK to submit');
        }else{
            alert('Form contains invalid data.  Please correct first');
            return false;
        }
        return true;
    </script>
        <div data-dojo-type="dojo/store/Memory"
    data-dojo-id="stateStore"
    data-dojo-props="data: [{id: 'y', name: 'yes'}, {id: 'n', name: 'no'}]"></div>
    <%=JsonData %>
    <div id="Master">
    <% =MasterHTML %>
    </div>
    <div id="Detail">
    <% =DetailTableHtml%>
    </div>
    <button data-dojo-type="dijit/form/Button" type="button" onClick="console.log(myForm.getValues())">Get Values from form!</button>
    <button data-dojo-type="dijit/form/Button" type="submit" name="submitButton" value="Submit">Submit</button>
    <button data-dojo-type="dijit/form/Button" type="reset">Reset</button>
</div>
</body>
</html>

<%--
    Form
    http://dojotoolkit.org/reference-guide/1.8/dijit/index.html#dijit-index
     --%>